﻿{% extends "base.html" %}
{% block scripts %}
{% endblock %}
{% block content %}
    <h1>Заказы  <img class="icon" src="/media/images/icon_arrow_1.gif" width="11" height="5"> Ищу-контент менеджера</h1>

    <div class="order_block">
        <div class="order_header">
            <img class="pic"
                    {% if order.user.user_info.avatar %}
                 src="{{ order.user.user_info.avatar.url }}"
                    {% if order.user.user_info.avatar.width > order.user.user_info.avatar.height %} width="79" {% else %} height="79" {% endif %}
                    {% else %}
                 src="/media/images/img_no.gif" width="79" height="79"
                    {% endif %}
                    />

            <div class="info"><a href="/profile/{{ order.user.id }}/">{{ order.user.user_info.last_name }} {{ order.user.user_info.first_name }}</a> <span class="date">({{ order.order_date }})</span></div>
            <h2 class="block_header">{{ order.subj }}</h2>
            {% if order.price %}
                <dl class="budget"><dt>Бюджет:</dt> <dd>{{ order.price }}р/заказ</dd></dl>
            {% endif %}
        </div>
        <div class="order_text">
            {{ order.text|linebreaksbr }}
        </div>
    </div>

    <div class="order_reply">
        <form class="form_2 " action="" method="post">

            <h2 class="block_header">Выберите компанию</h2>
            <select name="company" id="id_company">
                {% for company in request.user.companies.all %}
                <option value="{{ company.id }}" {% if forloop.first %}selected="selected"{% endif %}>{{ company.name }}</option>
                {% endfor %}
            </select>

            {% if form.text.errors %}
                <dt><p class="error_message">{{ form.text.errors|striptags }}</p></dt>
            {% endif %}
            <h2 class="block_header"><label for="id_text">Текст ответа</label></h2>
            <textarea id="id_text" name="text" cols="80" rows="5"></textarea>

            <div class="buttons"><input class="button" type="submit" value="Ответить"></div>
        </form>

    </div>

{% endblock %}